﻿using System;
using System.Collections.Generic;

using DataFactory.Common;
using IDAL.Common;
using Model.Common;
namespace BLL.Common
{
    /// <summary>
    /// 业务层，通用内容，城市管理
    /// </summary>
    public class CityBLL
    {
        /// <summary>
        /// 城市映射
        /// </summary>
        private ICity dal = DataAccess.CreateCity();

        /// <summary>
        /// 获取全部省份
        /// </summary>
        /// <returns></returns>
        public IList<CityInfo> GetAllCity(int provinceID)
        {
            CityCondition condition = new CityCondition();
            condition.ProvinceID = provinceID;
            return dal.ListCity(condition);
        }

        /// <summary>
        /// 获取包含信息的城市
        /// </summary>
        /// <param name="provinceID"></param>
        /// <returns></returns>
        public IList<CityInfo> GetInfoCity(int provinceID)
        {
            CityCondition condition = new CityCondition();
            condition.ProvinceID = provinceID;
            condition.HasInfo = "y";
            return dal.ListCity(condition);
        }
    }
}
